import { defineNuxtConfig } from 'nuxt/config'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  app: {
    pageTransition: { name: 'el-fade-in-linear', mode: 'out-in' },
    // layoutTransition: false
  },
  compatibilityDate: '2025-05-15',
  devtools: { enabled: true },
  modules: [
    '@nuxt/eslint',
    '@pinia/nuxt',
    'pinia-plugin-persistedstate/nuxt',
    '@unocss/nuxt',
    '@element-plus/nuxt',
  ],
  css: [
    '@unocss/reset/tailwind.css',
    '@/assets/scss/index.scss'
  ],
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          api: 'modern-compiler',
          additionalData: '@use "@/assets/scss/element/index.scss" as element;',
        },
      },
    },
  },
  elementPlus: {
    importStyle: 'scss',
  },
  imports: {
    presets: [
      {
        from: 'alova/client',
        imports: [
          'useRequest',
          'usePagination',
        ]
      }
    ]
  },
  srcDir: 'src/',
  devServer: {
    host: '0.0.0.0',
    port: 3000
  },
  runtimeConfig: {
    // 仅在服务器端可用
    apiServer: 'http://shanhe.kim',

    // 暴露给客户端
    public: {
      apiBase: 'http://official.sckcn.cn: 3000'
    }
  }
})
